package com.designpatterns.factory.factory1.pizzaFactoy;

import com.designpatterns.factory.factory1.pizza.Pizza;
import com.designpatterns.factory.factory1.pizzaImp.CheesePizza;
import com.designpatterns.factory.factory1.pizzaImp.ClamPizza;
import com.designpatterns.factory.factory1.pizzaImp.PepperoniPizza;
import com.designpatterns.factory.factory1.pizzaImp.VeggiePizza;

public class SimplePizzaFactory {
    public Pizza createPizza(String type) {
        Pizza pizza = null;
        if(type.equals("cheese")) {
            pizza = new CheesePizza();
        } else if(type.equals("pepperoni")){
            pizza = new PepperoniPizza();
        } else if(type.equals("clam")){
            pizza = new ClamPizza();
        } else if(type.equals("veggie")) {
            pizza = new VeggiePizza();
        }
        return pizza;
    }
}
